{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "6873342f-7b5b-4384-a8b6-5bb2895c72c9",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import os\n",
    "import shutil\n",
    "\n",
    "# 读取csv文件\n",
    "path = '../dataset/FundusDataset/Csv/train_data.csv'\n",
    "df = pd.read_csv(path)\n",
    "\n",
    "image_path = '../dataset/FundusDataset/Image/'\n",
    "\n",
    "# 遍历每一行\n",
    "for index, row in df.iterrows():\n",
    "    shutil.copy(image_path + row['Left-Fundus'], './data/test_data')\n",
    "    shutil.copy(image_path + row['Right-Fundus'], './data/test_data')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "34ffee9f-4a3a-4769-8a44-82a8e3f87657",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
